﻿using System;
using System.Collections.Generic;

namespace Sustainalytics.ClientDW.Entities
{
    public class GCPrincipleEventIndicator : IEqualityComparer<GCPrincipleEventIndicator>
    {
        public Guid Id { get; set; }
        public Guid PrincipleSummaryId { get; set; }
        public string IssueType { get; set; }
        public GCAssessment EventIndicatorAssessment { get; set; }
        public string EventSummary { get; set; }


        public void LoadFrom(GCPrincipleEventIndicator data)
        {
            this.Id = data.Id;
            this.PrincipleSummaryId = data.PrincipleSummaryId;
            this.IssueType = data.IssueType;
            this.EventIndicatorAssessment = data.EventIndicatorAssessment;
            this.EventSummary = data.EventSummary;
        }

        public bool Equals(GCPrincipleEventIndicator x, GCPrincipleEventIndicator y)
        {
            if (x == null && y == null)
                return true;

            if (x == null || y == null)
                return false;

            return
                x.Id == y.Id
                && x.PrincipleSummaryId == y.PrincipleSummaryId
                && x.IssueType == y.IssueType
                && x.EventIndicatorAssessment == y.EventIndicatorAssessment
                && x.EventSummary == y.EventSummary;
        }

        public int GetHashCode(GCPrincipleEventIndicator obj)
        {
            return this.Id.GetHashCode();
        }
    }
}
